<template>
<div class="fixed-r">
    <ul class="fixed-r-ul">
        <li class="a-mouse fixed-r-cart">
            <span class="car-sum" v-show="$store.getters.getNum>0&&$store.getters.isLogin">{{$store.getters.getNum}}</span>
            <div class="fixed-r-icon-box" @click="goto"></div>
            <p>购物车</p>
        </li>
    </ul>
</div>
</template>
<script setup>
import {useRouter} from 'vue-router'
const router = useRouter()
const goto = ()=>{
    router.push("/cart")
}
</script>
<style scoped>
.fixed-r {
    position: fixed;
    top: 300px;
    right: 0;
    user-select: none;
    z-index: 100000;
    margin: 0px auto;
    padding: 0px;
}

.fixed-r-ul {
    margin-bottom: 10px;
    background: #fff;
    -webkit-box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
    box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    margin: 0px auto;
    padding: 0px;
}

.fixed-r-ul li {
    box-sizing: initial;
    width: 84px;
    height: 68px;
    padding-top: 12px;
    text-align: center;
    line-height: 28px;
    font-size: 12px;
    position: relative;
    color: #333;
    list-style: none;
}

.fixed-r-ul li p {
    margin: 0px;
}

.car-sum {
    box-sizing: border-box;
    padding: 0 4px;
    min-width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    -webkit-border-radius: 14px;
    -moz-border-radius: 14px;
    border-radius: 14px;
    background-color: #eb612a;
    color: #ffffff;
    display: block;
    font-size: 12px;
    position: absolute;
    left: 46px;
    top: 6px;
}

.fixed-r-icon-box {
    background: url(../assets/img/cart_icon_normal.png) center center no-repeat;
    background-size: 24px 24px;
    width: 30px;
    height: 30px;
    overflow: hidden;
    margin: 0 auto;
}

.a-mouse {
    cursor: pointer;
}
</style>